<?php if($this->session->flashdata('message')): ?>
    <div class="message">
        <?php echo $this->session->flashdata('message');?>
    </div>
<?php endif; ?>

<?php if (validation_errors()): ?>
    <div class="error">
        <?php echo validation_errors(); ?>
    </div>
<?php endif; ?>
<form name="main_form" id="main_form" action="<?php echo site_url('admin/setup/update'); ?>" method="post">
<!-- Jquery TAb-->
<div class="subtab">
	<div id="tabs">
		<ul class="tabs">
			<li><a href="#tabs-1">Numbering</a></li>
			<!--<li><a href="#tabs-2">Transactions</a></li>-->
		</ul>
		<div class="tab_container">
			<div id="tabs-1" class="tab_content">
				<fieldset>
					<table class="table-grid">
						<thead>
						<tr>
							<!--<td>Enable</td>-->
							<th>Type</th>
							<th>Prefix</th>
							<th>Suffix</th>
							<th>Minimum Digits</th>
							<th>Initial Number</th>
							<th>Current Number</th>
						</tr>
						</thead>
						<tbody>
						<?php $i = 0; ?>
						<?php foreach($numberings as $numbering): ?>
						
						<tr <?php echo ($i % 2) ? "class='even'" : "class='odd'"; ?> >
							<!--<td><input type="checkbox" name="enable[]" /></td>-->
							<td>
								<input type="hidden" size="15" class="textfx" name="autogen_type[]" value="<?php echo $numbering->autogen_type; ?>" />
								<?php echo $numbering->autogen_type; ?>
							</td>
							<td><input type="text" size="15" class="textfx" name="autogen_prefix[]" value="<?php echo $numbering->autogen_prefix; ?>" class="textfx" /></td>
							<td><input type="text" size="15" class="textfx" name="autogen_suffix[]" value="<?php echo $numbering->autogen_suffix; ?>" class="textfx" /></td>
							<td><input type="text" size="15" class="textfx" name="autogen_min_digits[]" value="<?php echo $numbering->autogen_min_digits; ?>" class="textfx" /></td>
							<td><input type="text" size="15" class="textfx" name="autogen_initial_number[]" value="<?php echo $numbering->autogen_initial_number; ?>" class="textfx" /></td>
							<td><input type="text" size="15" class="textfx" name="autogen_current_number[]" value="<?php echo $numbering->autogen_current_number; ?>" class="textfx" /></td>
						</tr>
						<?php $i++; ?>
						<?php endforeach; ?>
						</tbody>
					</table>
				</fieldset>
			</div>
		</div>
	</div>
</div>
<!--end of tab-->
<fieldset id="action">
	<a href="#" class="btn btn-save"><span class="btn-icon disk-icon"></span><?php echo lang('admin_button_save'); ?></a>
	<a href="<?php echo site_url('student/student'); ?>" class="btn btn-cancel"><span class="btn-icon cancel-icon"></span><?php echo lang('admin_button_cancel'); ?></a>
</fieldset>
</form>

<script>
	$('.btn-save').click(function(){
		$('form').submit();
		return false;
	});
</script>